package com.min.license.config;


import com.min.license.LicenseManager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
@EnableConfigurationProperties(LicenseProperties.class)
public class LicenseConfigure {
    @Autowired
    LicenseProperties properties;

    @Bean
    @ConditionalOnMissingBean
    LicenseManager licenseManager() {
        return new LicenseManager(properties);
    }

}
